﻿using System;
using System.Collections.Generic;

namespace SBAudit
{
    /// <summary>
    /// Represents audit entry.
    /// </summary>
    public class AuditEntry
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AuditEntry"/> class.
        /// </summary>
        public AuditEntry()
        {
            Fields = new List<AuditField>();
        }

        /// <summary>
        /// Gets or sets audit the action.
        /// </summary>
        /// <value>Audit action.</value>
        public AuditAction Action { get; set; }

        /// <summary>
        /// Gets or sets the name of entity table.
        /// </summary>
        /// <value>The name of entity table.</value>
        public string EntityTable { get; set; }

        /// <summary>
        /// Gets or sets the entity primary key value.
        /// </summary>
        /// <value>The entity primary key value.</value>
        public object EntityTableKey { get; set; }

        /// <summary>
        /// Gets or sets the audit date.
        /// </summary>
        /// <value>The audit date.</value>
        public DateTime AuditDate { get; set; }

        /// <summary>
        /// Gets or sets the name of the user who made changes.
        /// </summary>
        /// <value>The name of the user who made changes.</value>
        public string UserName { get; set; }

        /// <summary>
        /// Gets or sets audit fields.
        /// </summary>
        /// <value>Audit fields.</value>
        public IList<AuditField> Fields { get; private set; }
    }
}
